#  author:张靖昆 date:2020/3/10 name:04_datetime IDE:PyCharm
import datetime
# datetime类包含什么
# now_time=datetime.datetime.now()
# print(now_time)
# 获取国家标准时间
# g_time=datetime.datetime.utcnow()
# print(g_time)

# datetime类和字符串的相互转化
# 1.str===>datetime
# ss='2020-11-11 08:00:00'
# ss_time=datetime.datetime.strptime(ss,"%Y-%m-%d %H:%M:%S")
# print(ss_time)

# 2.datetime===>str
# 方法一
now_time=datetime.datetime.utcnow()
# print(str(now_time))
# print(type(str(now_time)))
# 方法二
now_time1=datetime.datetime.strftime(now_time,"%Y-%m-%d %H:%M:%S")
print(type(str(now_time)))